<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@ page import="com.fengke.portal.config.HostConfig" %>
<%
	HostConfig hostConfig = (HostConfig) request.getSession().getServletContext().getAttribute("hostConfig");
%>
<!DOCTYPE html>
<head>
	<base href="<%=hostConfig.getPortalHost() %>" />
	<title>
		<s:if test='productVO.productModel.name != null && !"".equals(productVO.productModel.name.trim())'>
			<s:property value="productVO.productModel.name" />
		</s:if>
		<s:else><%=hostConfig.getWebSiteName() %></s:else>
	</title>
	<meta name="keywords" content="<%=hostConfig.getWebSiteName() %>" />
	<meta name="description" content="<%=hostConfig.getWebSiteName() %>" />
	<meta charset="utf-8">
<script type="text/javascript">
	base = "<%=hostConfig.getPortalHost() %>";
	res = "";
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="decorator" content="modMobile">

<!-- <link href="resources/travel/weixin/css/animate.css" rel="stylesheet" media="screen"> -->
<!-- <link href="resources/travel/weixin/css/base.css" rel="stylesheet" media="screen"> -->

<link href="resources/travel/weixin/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/bootstrap-theme.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/font-awesome.min.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/messenger.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/image.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/css/travel.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/jslib/icheck/skins/flat/blue.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/jslib/jquery-validation-engine/css/validationEngine.jquery.css" rel="stylesheet" media="screen">
<link href="resources/travel/weixin/jslib/mobiscroll-calendar/css/mobiscroll.custom-2.14.4.min.css" rel="stylesheet" media="screen">

<script src="resources/travel/weixin/js/jquery.min.js"></script>
<script src="resources/travel/weixin/js/bootstrap.min.js"></script>
<script src="resources/travel/weixin/js/bootbox.js"></script>
<script src="resources/travel/weixin/js/messenger.js"></script>
<script src="resources/travel/weixin/js/messenger-theme-future.js"></script>
<script src="resources/travel/weixin/js/holder.js"></script>


<script src="resources/travel/weixin/js/jquery.mousewheel.js"></script>
<script src="resources/travel/weixin/js/nicescroll.js"></script>

<script src="resources/travel/weixin/js/TouchSwipe.js"></script>
<script src="resources/travel/weixin/js/swiper/swiper.js"></script>

<script src="resources/travel/weixin/js/s/scrollbar.js"></script>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="resources/travel/weixin/js/wxapi.js?rn=100"></script>

<script src="resources/travel/weixin/jslib/icheck/js/jquery.icheck.min.js"></script>
<script src="resources/travel/weixin/jslib/jquery-validation-engine/js/languages/jquery.validationEngine-zh_CN.js"></script>
<script src="resources/travel/weixin/jslib/jquery-validation-engine/js/jquery.validationEngine.js"></script>
<script src="resources/travel/weixin/jslib/mobiscroll-calendar/js/mobiscroll.custom-2.14.4.min.js"></script>
<script src="resources/travel/weixin/js/application.js"></script>
<script type="text/javascript" src="resources/shop/js/common.js"></script>

<script type="text/javascript">
$(function() {
	wxApiInit();

	wx.ready(function() {
		// 微信分享的数据
		var successCallback = function() {

		};

		var wxData = {
			title : '<s:property value="productVO.productModel.name"/>',
			desc : "<s:property value='productVO.productModel.name' />",
			link : 'http://fengkeworld.com/travel/weixin/product/<s:property value="productVO.productModel.id"/>.html',
			imgUrl : '<s:property value="productVO.productModel.image"/>',
			success : function() {
				successCallback();
			},
			cancel : function() {
			}
		};

		wx.onMenuShareTimeline(wxData); // 分享到朋友圈
		wx.onMenuShareAppMessage(wxData); // 分享到朋友
		wx.onMenuShareQQ(wxData); // 分享到QQ
		wx.onMenuShareWeibo(wxData); // 分享到微博
	});
});
</script>
<script type="text/javascript">
var myScroll;
var isScroll = true;
var y = 0;
var page = 0;
var mySwiper;

//竖直滚动
var holdPosition = 0;
var holdPosition2 = 0;
var holdPosition3 = 0;

var hasTouch = true ;//判断手是否离开了屏幕
var isMobile = true;
function loaded() {
	$("img").lazyload({
		effect: "fadeIn",
		skip_invisible : false,
	});
}

//此处可以用来判断是否发生了横屏竖屏变化
$(window).on('resize', function() {
	$('.swiper-container').css({
		height : $(window).height() - 90
	});
});
</script>
<style type="text/css">
li {
	list-style: none
}
</style>
</head>
<body>
	<div id="body" style="width: 100%;">
		<div id="slider" class="container">
			<div class="row">
				<div class="bs-example detail_carousel">
					<div id="carousel-generic" class="carousel carousel-generic slide" data-ride="carousel">
						<ol class="carousel-indicators bottom0">
							<s:if test="productVO.productImageModels != null">
								<s:iterator value="productVO.productImageModels" var="image" status="countIdx">
									<s:if test='#countIdx.index == 0'>
										<li class="active" data-slide-to="0" data-target="#carousel-example-captions"></li>
									</s:if>
									<s:elseif test="#countIdx.index < 10">
										<li data-slide-to="<s:property value='#countIdx.index' />" data-target="#carousel-example-captions" class=""></li>
									</s:elseif>
								</s:iterator>
							</s:if>
						</ol>
						<div class="usercenter_ico usercenter_icofixed">
							<a href="travel/weixin/user/index.html" class="usercenter-back"></a>
						</div>
	
						<div class="usercenter_ico usercenter_icofixed" style="left: 10px; z-index: 99 !important;">
							<a href="travel/weixin/index.html" style="left: 0px;" class="home_back"></a>
						</div>
	
						<div role="listbox" class="carousel-inner">
							<s:if test="productVO.productImageModels != null">
								<s:iterator value="productVO.productImageModels" var="image" status="countIdx">
									<s:if test="#countIdx.index < 10">
										<div class="item <s:if test='#countIdx.index == 0'>active</s:if>">
											<img src="<s:property value='#image.source' />">
										</div>
									</s:if>
								</s:iterator>
							</s:if>
							<s:else>
								<div class="item ">
									<img src="resources/travel/weixin/images/carousel4.jpg">
								</div>
							</s:else>
						</div>
					</div><!-- carousel-generic -->
					<div class="detail_caption col-sm-12 col-xs-12 clearfix animated fadeInDown">
						<h4>
							<a href="#"><s:property value="productVO.productModel.name" /></a>
						</h4>
						<div class="address clearfix showGoDate">
							<p class="departure ">
								<span class="times"></span><i>查看出行日期</i>
							</p>
	<!-- 						<p class="count"> -->
	<!-- 							¥<i>0</i>起 -->
	<!-- 						</p> -->
						</div>
						<p class="content">提供商：<s:property value="productVO.productModel.serviceProvider" /></p>
					</div><!-- detail_caption -->
				</div>
			</div><!-- row -->
			<s:if test="productVO.productModel.productFeatures != null">
				<div class="row ">
					<div
						class="col-sm-12 col-xs-12 padding_0 travel_teristics animated fadeInDown">
						<div class="title clearfix">
							<span class="teristics"></span>
							<h4>
								<span class="teristics_fonts aaa">风客有话说</span>
							</h4>
						</div>
						<div class="teristics_introduction list_styleyes imageEdit clearfix">
							<s:property value="productVO.productModel.productFeatures" escapeHtml="false" />
						</div>
					</div>
				</div>
			</s:if>
			<div class="row " >
				<div class="col-sm-12 col-xs-12 padding_0 travel_teristics user_evaluation animated fadeInDown">
					<div class="title clearfix">
						<span class="teristics money_icon"></span>
						<h4>
							<span class="teristics_fonts">对阵双方</span>
						</h4>
					</div>
					<div class="media lastDiv  animated fadeInDown margin-top0">
						<div class="col-xs-12 teristics_introduction imageEdit">
							<p>北京国安VS上海上港</p>
						</div>
					</div>
				</div>
			</div>
			
			<div class="row ">
				<div class="col-sm-12 col-xs-12 padding_0 travel_teristics user_evaluation animated fadeInDown">
					<div class="title clearfix">
						<span class="teristics money_icon"></span>
						<h4>
							<span class="teristics_fonts">参与方式</span>
						</h4>
					</div>
					<div class="media lastDiv  animated fadeInDown margin-top0">
						<div class="col-xs-12 teristics_introduction imageEdit">
							<p style="margin: 10px auto;">直接购买</p>
							<p style="margin: 10px auto;">备注：球票来源于主办方，且票源稳定，风客会保留以上活动的一切解释权。</p>
						</div>
					</div>
				</div>
			</div><!-- row -->
			
			<div class="row ">
				<div class="col-sm-12 col-xs-12 padding_0 travel_teristics user_evaluation animated fadeInDown">
					<div class="title clearfix">
						<span class="teristics money_icon"></span>
						<h4>
							<span class="teristics_fonts">支付方式</span>
						</h4>
					</div>
					<div class="media lastDiv  animated fadeInDown margin-top0">
						<div class="col-xs-12 teristics_introduction imageEdit">
							<p style="margin: 10px auto;">1、支付宝</p>
							<p style="margin: 10px auto;">2、微信支付（由于微信不提供订阅号支付功能，所以请识别下方二维码，成功后，关注风客世界服务号“叫上”下单。）</p>
							<p style="margin: 10px auto;" align="center"><img width="320px" src="http://fengkeworld.com/picture/20150701/60826741977168118.gif"/></p>
							<p style="margin: 10px auto;">活动详情及事项咨询请加风客小二微信：1633126799（注明风客购票）</p>
						</div>
					</div>
				</div>
			</div><!-- row -->
			
			<div class="row ">
				<div class="col-sm-12 col-xs-12 padding_0 travel_teristics user_evaluation animated fadeInDown">
					<div class="title clearfix">
						<span class="teristics money_icon"></span>
						<h4>
							<span class="teristics_fonts">领票方式</span>
						</h4>
					</div>
					<div class="media lastDiv  animated fadeInDown margin-top0">
						<div class="col-xs-12 teristics_introduction imageEdit">
							<p style="margin: 10px auto;">快递到付</p>
						</div>
					</div>
				</div>
			</div><!-- row -->
		</div><!-- slider -->
	</div><!-- body -->
	<form id="create_confirmed_Order_form" action="travel/weixin/order/createConfirmedOrder.action" method="post">
	<div id="orderMain" class="container overflow-x">
		<div class="row">
			<div class="col-xs-12 col-sm-12 padding_0 order_list">
				<div id="accordion-1" class="panel-group acc-v1 margin-bottom-0 ">
					<div class="panel panel-default margin-bottom-10">
					  <div class="panel-heading collapseDiv" onclick="$(this).next().collapse('toggle')">
			            <h4 class="panel-title clearfix"> 
				            <a class="accordion-toggle clearfix"  >
					            <span class="glyphicon glyphicon_peoples glyphicon_size pull-left" ></span>
					            <span class="pull-left itineraryfonts">选择参与方式</span>
					            <span class="bluearrow  bluedownarrow pull-right"></span>
				            </a>
			            </h4>
			          </div>
			          <div class="panel-collapse collapse in">
			            <div class="panel-body">
			              <div class="row">
			                <div class="col-xs-12 itinerary_show">
			                  <a id="attend_item_4" class="attend" data-value="150" onclick="select_item(this);">150元</a>
			                  <style>
			                  a.attend {
			                  	display: inline-block;
			                  	padding: 10px;
			                  	border: 1px solid #22cbc4;
			                  	color: #646464;
			                  	border-radius: 4px;
			                  	box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
			                  	transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
			                  	text-decoration: none;
			                  	margin: 10px;
			                  }
			                  .selected {
			                    background: #22cbc4 none repeat scroll 0 0;
			                    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
			                    color: #fff;
			                  }
			                  </style>
			                  <script type="text/javascript">
			                  /**
			                  	function select_item(num) {
			                  		if(num == 0) {
			                  			$('#attend_item_0').addClass('selected');
			                  			$('#attend_item_1').removeClass('selected');
			                  			$('#totalPrice').html(180);
			                  			$('#input_productPrice').attr('value', '180');
			                  		} else if(num == 1) {
			                  			$('#attend_item_0').removeClass('selected');
			                  			$('#attend_item_1').addClass('selected');
			                  			$('#totalPrice').html(342);
			                  			$('#input_productPrice').attr('value', '342');
			                  		}
			                  	}
			                  **/
			                    function select_item(obj) {
			                	  var attent_items = $("a[id^='attend_item']");
			                	  if(attent_items != null) {
			                		for(var i = 0; i < attent_items.length; i ++) {
			                		  $(attent_items[i]).removeClass('selected');
			                		}
			                		$(obj).addClass('selected');
			                		var item_value = $(obj).data('value');
			                		if(!isNaN(item_value)) {
			                		  $('#totalPrice').html('￥' + item_value);
			                  		  $('#input_productPrice').attr('value', item_value);
			                		}
			                	  }
			                    }
			                  </script>
			                </div>
			              </div>
			            </div>
			          </div>
					</div>
					
					<div class="panel panel-default  margin-bottom-10" style="overflow:visible" >
				      <div class="panel-heading collapseDiv" onclick="$(this).next().collapse('toggle')">
				         <h4 class="panel-title clearfix">
				           <a class="accordion-toggle clearfix ">
				             <span class="glyphicon glyphicon_linkman glyphicon_size pull-left"></span>
				             <span class="pull-left itineraryfonts">联系人信息</span>
				             <span class="bluearrow  bluedownarrow pull-right"></span>
				           </a>
						 </h4>
				      </div>
				      <div id="collapse-Three" class="panel-collapse collapse in" >
			            <div class="panel-body" >
			              <div class="row">
			                <div class="col-xs-12 itinerary_show form-horizontal"  >
			                  <div class="form-group user_news">
			                    <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputEmail3" style="padding-top:7px">姓名</label>
			                    <div class="col-sm-4 col-xs-9">
			                      <input type="text" placeholder="请输入姓名" id="input_phoneName" name="input_phoneName" value="" class="validate[required] form-control" maxlength="20" data-prompt-position="topLeft:10">
			                    </div>
			                  </div>
			                  
			                  <div class="form-group user_news">
			                   <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputPassword3" style="padding-top:7px">性别</label>
			                  	<label class="radio-inline" style="width: 30%; text-align: left; padding-left: 35px;">
								    <input type="radio" name="input_gender" value="male" checked id="radio_gender_1" style="position: relative;margin-right: 10px;">男
								</label>
				        	    <label class="radio-inline" style="width:30%;text-align:left">
							         <input type="radio" name="input_gender" value="female" id="radio_gender_2">女
							    </label>
			                  </div>
			                  
			                  <div class="form-group user_news">
			                    <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputEmail3"  style="padding-top:7px">电话</label>
			                    <div class="col-sm-4 col-xs-9" style="margin-bottom: 10px;">
			                      <input type="text" id="input_phone" name="input_phone" placeholder="请输入电话号码" value="" id="inputPhoneNum" class="form-control"  data-prompt-position="topLeft:10">
			                    </div>
			                  </div>
			                 
			                  <div class="form-group user_news" style="display: none;">
			                    <label class="col-sm-2 control-label col-xs-2 padding_right0" for="inputEmail3" style="padding-top:7px">邮箱</label>
			                    <div class="col-sm-4 col-xs-9">
			                      <input type="text" id="input_email" placeholder="请输入邮箱" name="input_email" value="" class="form-control" data-prompt-position="topLeft:10">
			                    </div>
			                  </div>
			                  <div class="form-group user_news">
			                    <label class="col-sm-2 control-label col-xs-2 padding_right0" for="input_address" style="padding-top:7px">地址</label>
			                    <div class="col-sm-4 col-xs-9">
			                      <input type="text" id="input_address" placeholder="请输入收件地址" name="input_address" value="" class="form-control" data-prompt-position="topLeft:10">
			                    </div>
			                  </div>
			                </div>
			              </div>
			            </div>
			          </div>
					</div>
					
					<div class="panel panel-default  margin-bottom-20  animated fadeInDown">
			          <div class="panel-heading collapseDiv" onclick="$(this).next().collapse('toggle')">
			            <h4 class="panel-title clearfix">
			              <a class="accordion-toggle clearfix"  >
			                <span class="glyphicon glyphicon_peoples glyphicon_size pull-left" ></span>
			                <span class="pull-left itineraryfonts">选择支付方式</span>
			                <span class="bluearrow  bluedownarrow pull-right"></span>
			              </a>
			            </h4>
			          </div>
			          <div class="panel-collapse collapse in" >
			                  <div class="panel-body message_body">
			                    <div class="row">
			                      <div class="col-xs-12 itinerary_show message_dl">
			                        <dl style="margin-left: 30px;">
			                          <dt class="clearfix"><input type="radio" name="input_paymentType" id="input_paymentType_0" value="weixin" checked="checked" style="margin-right: 10px;"><span><label for="input_paymentType_0">微信支付</label></span></dt>
			                          <dt class="clearfix"><input type="radio" name="input_paymentType" id="input_paymentType_1"  value="ali" style="margin-right: 10px;"><label for="input_paymentType_1">支付宝支付</label></dt>
			                     	</dl>
			                      </div>
			                    </div>
			                  </div>
			              </div>
			          </div>
				</div>
			</div>
		</div>
		<div id="buyNow">
			<div class="row">
				<div class="col-xs-12 col-sm-12">
					<div class="total">
						总计：<span id="totalPrice">150</span>
					</div>
				</div>
			</div>
			<div class="row" >
	        <div class="col-xs-12 col-sm-12 term_box">
	          <div class="total term">
	            <div class="pull-left" onclick="agreementContract(this);">
		          <span class=" pull-left  position_reative">
		            <div class="icheckbox_polaris" id="agreement_div">
		              <input type="checkbox" tabindex="22" style="position: absolute; top: 10%; left: 10%; display: block; width: 80%; height: 80%; margin: 0px; padding: 0px; background: none repeat scroll 0% 0% rgb(255, 255, 255); border: 0px none; opacity: 0;">
		              <ins style="position: absolute; top: 10%; left: 10%; display: block; width: 80%; height: 80%; margin: 0px; padding: 0px; background: none repeat scroll 0% 0% rgb(255, 255, 255); border: 0px none; opacity: 0;"></ins>
		            </div>
		          </span>
		          <span class="pull-left itineraryfonts ml_42 total term" style="color: #000; font-size: 1.05em; font-weight: normal;">我已阅读并同意<i onclick="$('#agreement_content_div').toggle();">《风客预定条款》</i></span>
	            </div>
			  </div>
		    </div>
	      </div>
		
		</div>
		<div id="qun_zxing" align="left" style="margin-bottom: 50px;">
			<div id="agreement_content_div" style="display: none;">
				<h3 style="text-align: center;">《线下活动免责声明》</h3>
				<p style="text-indent: 2em;">1、本免责声明适用于参与风客会所有活动的所有人员。</p>
				<p style="text-indent: 2em;">2、凡报名活动的参加者均视为具有完全民事行为能力人，如在活动中发生人身损害后果，赔偿责任本网站、发起人、赞助商均不承担，由受损害人依据法律规定和本声明依法解决，凡报名者均视为接受本声明。如报名者为未成年人或无民事行为能力人或限制民事行为能力人，则其监护人同意在活动中发生人身损害后果，赔偿责任本网站、发起人、赞助商均不承担，由监护人或受损害人依据法律规定和本声明依法解决，监护人虽没有直接报名仍视为接受本声明。代他人报名者，被代报名参加者如遭受人身损害，赔偿责任本网站、发起人、赞助商同样均不承担。本声明是根据最高人民法院于2004年5月1日起颁布施行的《关于审理人身损害赔偿案件适用法律若干问题的解释》而制定。</p>
				<p style="text-indent: 2em;">3、活动中风客会、发起人、赞助商对活动进行组织协调，但活动性质属于自愿参加、风险自担、责任自负，参与者均应为完全行为能力人，风客会、发起人、赞助商并不从活动组织中收取任何费用或盈利，亦不构成本网站、发起人、赞助商的经营行为，风客会、发起人、赞助商不对任何个人或机构承担民事赔偿责任或补充民事赔偿责任。</p>
				<p style="text-indent: 2em;">4、风客会、发起人、赞助商对活动仅提供信息发布服务，并不担保或提供任何参加人的人身和财产的安全保障。风客会、发起人、赞助商的组织和发起户外活动之行为，在任何情况下不构成违反对设施设备未尽安全保障义务，不构成违反服务管理未尽安全保障义务，不构成违反防范制止侵权行为未尽安全保障义务，也不构成对未成年人、无民事行为能力人、限制民事行为能力人未尽安全保障义务。</p>
				<p style="text-indent: 2em;">6、活动报名后本声明将自动生效并表明参加者已接受，否则，请退出参加报名活动。</p>
			</div>
		</div>
	</div><!-- orderMain -->
	<input type="hidden" id="input_productId" name="input_productId" value="<s:property value="productVO.productModel.id" />" />
	<input type="hidden" id="input_productPrice" name="input_productPrice" value="150" />
	<input type="hidden" id="input_startingDate" name="input_startingDate" value="2015-07-21" />
	</form>
	<div id="footer">
		<div class="row" style="width: 100%;">
			<div class="col-xs-12 col-sm-12 padding_10 ">
				<div class="bottom_btnbox">
					<div class="left_consultationbtn pull-left callPhone">
						<a class="btn consultation detail_bottombtn " type="button" href="tel:400-9655797">
							<i class="fa fa_mobile fa_smallicon"></i>电话咨询
						</a>
					</div>
					<!-- ${product.phone}-->
					<div class="right_buynowbtn pull-right">
						<a id="create_confirmed_Order_button" class="btn consultation detail_bottombtn btn buy_now margin_right0 detail_bottombtn " type="button">
							<i class="fa fa_check_square fa_smallicon"></i>立即预定
						</a>
					</div>
				</div>
				<!--电话资询弹出框-->
				<div class=" modal-sm modal_news animated fadeInLeftBig mobileModel" style="display: none">
					<div class="modal-content">
						<div class="modal-header">
							<h4 id="mySmallModalLabel" class="modal-title">提示</h4>
							<p id="mobileModel_message">该产品当前无法预定!</p>
						</div>
						<div class="modal-body clearfix modal_btngroup">
							<a class="sure btn mobileCancle" data-dismiss="modal">确定</a>
							<a class="close btn mobileCancle" data-dismiss="modal" type="button">取消</a>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
				<!--电话资询弹出框-->
			</div>
		</div>
		<div id="topcontrol" class="back_top" style="position: fixed; bottom: 4.5em; right: 0.4em; opacity: 1; cursor: pointer; display: none" title="Scroll Back to Top">
			<a href="#"></a>
		</div>
	</div>
</body>
<script type="text/javascript">
$(function($) {
	$("a[id^='attend_item']").last().click();
	// 提交订单
	$('#create_confirmed_Order_button').click(function() {
		$("#input_phoneName").removeClass();
    	$("#input_phoneName").addClass("validate[required] form-control");
		$("#input_phone").removeClass();
    	$("#input_phone").addClass("validate[required,funcCall[checkPhoneNum]] form-control");
    	$("#input_email").removeClass();
    	$("#input_email").addClass("validate[required, custom[email] form-control");
    	var result = $('form[id="create_confirmed_Order_form"]').validationEngine('validate');
    	if(!result || !$('#agreement_div').hasClass('checked')){
    		if(!$('#agreement_div').hasClass('checked')) {
    			$('#mobileModel_message').html('请同意协议！');
    			$(".mobileModel").show();
    		}
       		return false;
       	}
    	$('#create_confirmed_Order_form').submit();
	});
	
	$('#input_phoneName').focusout(function(){
		$(this).removeClass();
    	$(this).addClass("validate[required] form-control");
	});
	$('#input_phone').focusout(function(){
		$(this).removeClass();
    	$(this).addClass("validate[required,funcCall[checkPhoneNum]] form-control");
	});
	$('#input_email').focusout(function(){
		$(this).removeClass();
    	$(this).addClass("validate[required, custom[email] form-control");
	});
	
	$('#input_phoneName').focus(function(){
		$('.input_phoneNameformError').remove();
	});
	$('#input_phone').focus(function(){
		$('.input_phoneformError').remove();
	});
	$('#input_email').focus(function(){
		$('.input_emailformError').remove();
	});

	
	var dateStr="<s:property value='productVO.productModel.startingDate' />";
	var arrDate=dateStr.split(",");
	var arrDate1=[];
	for(var i=0;i<arrDate.length;i++){
		var d=new Date(arrDate[i]);
		arrDate1.push(d);
	}
	$(".callMobile").click(function() {
		$(".mobileModel").show();
	});
	$(".mobileCancle").click(function() {
		$(".mobileModel").hide();
	});
	$('.showGoDate').mobiscroll().calendar({
		
		theme: 'mobiscroll',
	    lang: 'zh',
	    display: 'bottom',
	    dateFormat:'yy-mm-dd',
	    minDate:new Date("<s:property value='productVO.productModel.defaultDateString' />"),
	    maxDate:new Date("<s:property value='productVO.productModel.maxDateStr' />"),
	    controls: ['calendar'],
	    invalid: ['w0','w1','w2','w3','w4','w5','w6'],
	    valid:arrDate1,
	    buttons: [ 
	              { 
	                  text: '取消查看',
	                  handler: function (event, inst) { 
	                	  $('.showGoDate').mobiscroll("hide");
	                  } 
	              },
	          ]
    }); 
	$(".showGoDate").click(function(){
		$('.showGoDate').mobiscroll("show");
	});
	$(".callPhone").click(function(){
		$(this).css("background","1dc5be");
	});
	
	$('input:radio').iCheck({
		checkboxClass : 'icheckbox_flat-blue',
		radioClass : 'iradio_flat-blue',
		increaseArea : '100%'
	});
	$(".mobileModel").click(function(){
		$(".mobileModel").hide();
	});
});
function checkPhoneNum(){
	var inputPhoneNum = $("#input_phone").val();
	var result;
	if(inputPhoneNum.trim()=="") {
 		
 	} else {
 		if(typeof(inputPhoneNum)=="undefined") {
			return false;
 		}
		if(inputPhoneNum == "" || inputPhoneNum == null) {
			return false;
		}
		
		if(inputPhoneNum.length!=11){
			result = "请输入11位手机号码";
		}
		
		var myreg = /^(1[3-9]{1}[0-9]{1})\d{8}$/;
		if(!myreg.test(inputPhoneNum)){
			result = "请输入合法的手机号码";
		}
		if(result) return result;
 	}
}
function agreementContract(obj) {
	var $this=$(obj);
	var input=$this.find("input");
	if(input.parent().hasClass('checked')) {
		input.parent().removeClass('checked');
		$('#submit_button').attr('disabled', 'disabled');
		$('#submit_button').unbind('click');
		$('#submit_button').css('background', '#c6c6c6 none repeat scroll 0 0');
	} else {
    	input.parent().addClass('checked');
    	$('#submit_button').bind('click', buyNow);
		$('#submit_button').css('background', '#22cbc4 none repeat scroll 0 0');
		$('#submit_button').removeAttr('disabled');
	}
}
</script>
</html>